<?php
/**
 * Formulaire de d'ajout de contact a une liste de diffusion
 * @author Etienne AUDOUIN <etienne.audouin@ingesup.com>
 * @author Adrien MARIANELLI <adrien.marianelli@ingesup.com>
 * @version 1.0
 * @package view_mailinglist_add
 */
$formAttributes = array ('id' => 'form_addContactTo');
$listContactAttributes = array();
$listNameAttributes = array('name'=>'input_listName');
foreach ($contactsToAdd as $contact){
    $listContactAttributes[$contact->id] = $contact->first_name." ".$contact->name;
}

echo form_fieldset('Add a contact');
echo form_open('webnews/addContactTo', $formAttributes);
echo '<table id="table_addContact">';

echo '<tr>';
echo '<th> Contact to add *</th>';
echo '<td>'.  form_multiselect('multi_listContact[]', $listContactAttributes).'</td>';
echo '</tr>';
echo '</table>';
echo form_hidden('list',$listInfo);
echo form_submit(null, 'Add');
echo form_close();
echo '<small>* Press <strong class="key">Maj</strong> or <strong class="key">Ctrl</strong> to select multiple contacts</small>';
echo form_fieldset_close();
?>